﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp1
{
    class Program
    {
       static  void Select(String name = null)
        {
            Console.WriteLine("Name:"+name);
        }

        static void Main(string[] args)
        {
            List<Emp> emps = new List<Emp>();
            IEnumerable<Emp> items = emps.Where(emp =>emp.Name =="name1");
            Func<Emp, string> textSelect = emp =>emp.Name ;
            for (int i = 0; i < 5; i++)
            {
                Emp emp = new Emp();
                emp.Name = "name" + i.ToString();
                emp.Age = i;
                emps.Add(emp);
            }
            Select();
            foreach (var item in emps)
            {
                Console.WriteLine("Name："+item.Name+",Age："+item.Name+";");
            }

            Console.WriteLine("---------------分割线---------------------");

           var emp2  =  emps.Where(emp1 => emp1.Age > 2);
           var emp3  =  emps.Where(emp=>emp.Age == 3);

            foreach (var item in items)
            {
                Console.WriteLine("Name：" + item.Name + ",Age：" + item.Name + ";");
            }

            Console.ReadKey();
        }
    }
    class Emp
    {
        public string Name { get; set; }
        public int Age { get; set; }
    }
    
}
